package com.bw.mapper;

import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoMapper {

    @Select("select bt.name,if(gender='M','男','女')'sex',sum(total_amount)'value' from order_info oi\n" +
            "left join user_info ui on oi.user_id = ui.id\n" +
            "left join base_trademark bt on oi.tm_id = bt.id\n" +
            "group by bt.name,gender")
    List<Vo1> getList();

    @Select("select bt.name,sum(total_amount)'value' from order_info oi\n" +
            "left join user_info ui on oi.user_id = ui.id\n" +
            "left join base_trademark bt on oi.tm_id = bt.id\n" +
            "group by bt.name")
    List<Vo> getList1();

    @Select("select bp.name,sum(total_amount)'value' from order_info oi\n" +
            "left join base_province bp on oi.province_id = bp.id\n" +
            "group by bp.name")
    List<Vo> getList3();

    @Select("select concat(substr(ui.birthday,3,1),'0后')'name',sum(total_amount)'value' from user_info ui\n" +
            "left join order_info oi on ui.id = oi.user_id\n" +
            "group by  concat(substr(ui.birthday,3,1),'0后')")
    List<Vo> getList2();
}
